package com.atguigu.gmall.feign.order;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.entity.OrderInfo;
import com.atguigu.gmall.order.vo.OrderConfirmDataVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * @author lfy
 * @Description  feign是一个发送HTTP请求的客户端，直接指定ip地址，固定调用
 * @create 2023-08-01 14:39
 */
@RequestMapping("/api/inner/order")
@FeignClient("service-order")
public interface OrderFeignClient {

    /**
     * 按照订单id查询订单数据
     * @param orderId
     * @return
     */
    @GetMapping("/info/{orderId}")
    Result<OrderInfo> getOrderInfoById(@PathVariable("orderId") Long orderId);

    /**
     * 返回订单确认页数据
     * @return
     */
    @GetMapping("/confirm/data")
    Result<Map<String,Object>> confirmDataVoResult();
}
